<?php
include($_SERVER['DOCUMENT_ROOT']."/config.php");
include($gDOCUMENT_ROOT_SYSTEM.'templates/include/lib.php');
include($gDOCUMENT_ROOT_SYSTEM.'/include/info.php');
include($gDOCUMENT_ROOT_SYSTEM.'/written_language/check_written_language.php');
include_once($gDOCUMENT_ROOT_SYSTEM.'/check_promulgator.php');

include_once($gDOCUMENT_ROOT_SYSTEM.'include/spokenLanguageAction.php');
$spokenLanguageAction = new spokenLanguageAction();
include_once($gDOCUMENT_ROOT_SYSTEM.'include/countryAction.php');
$countryAction = new countryAction();
include_once($gDOCUMENT_ROOT_SYSTEM.'include/filmAction.php');
$filmAction = new filmAction();
$country_id_and_name = $countryAction->getCountryIdAndName($user_agent['written_language_tag']);

include_once($gDOCUMENT_ROOT_SYSTEM.'include/copyrightAction.php');
$copyrightAction = new copyrightAction();
$copyright_id_and_name = $copyrightAction->getCopyrightIdAndName();

include_once($gDOCUMENT_ROOT_SYSTEM.'include/writtenLanguageAction.php');
$writtenLanguageAction = new writtenLanguageAction();
$written_language_tag_and_name = $writtenLanguageAction->getWrittenLanguageTagAndName();

$country_code_and_name = $countryAction->getCountryCodeAndName($user_agent['written_language_tag'],'en-US');
$spoken_language_id_and_name = $spokenLanguageAction->getSpokenLanguageIdAndName($user_agent['written_language_tag']);
//print_r($spoken_language_id_and_name);

$douban_id = $_GET['douban_id'];
$where = array('douban_id'=>$douban_id);
$column='*';
if($filmAction->isFilmExist($where))
{
	$film_info = $filmAction->getFilmDetail($where,$column,$user_agent['written_language_tag']);
	if(!$userAction->canIDo('edit_film'))
	{
		echo $language_pack['can_not_edit_film'];
		if(isset($_SERVER['HTTP_REFERER']))
		{
			echo '<a href="'.$_SERVER['HTTP_REFERER'].'">'.$language_pack['return'].'</a>';
		}
		exit;
	}
}
else
{
	header("Location: ./new_subject");
}

//输出模板
include($gDOCUMENT_ROOT_SYSTEM.'templates/'.$gTEMPLATE.'/html/detail_edit.tpl');

?>
